package gao.xiaolei.dao;

import gao.xiaolei.entity.Url;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository("UrlDao")
public interface UrlDao extends JpaRepository<Url, String> {

	@Query(value = "select count(*) from Url where url =:url")
	public int getUrlCount(@Param("url") String url);

	@Query(value = "select url from Url where id=:id")
	public String getUrlById(@Param("id") String id);
}
